package SetDemo.TreeSetSemo.demo1;

import java.util.TreeSet;

public class test {
    public static void main(String[] args){
        // 创建4个学生对象
        Student s1 = new Student("zhangsan", 18, 80, 70, 39);
        Student s2 = new Student("lisi", 20, 29, 56, 47);
        Student s3 = new Student("wangwu", 17, 20, 92, 28);
        Student s4 = new Student("zhaoliu", 19, 70, 23, 60);
        Student s5 = new Student("liuqi", 18, 59, 79, 39);
        Student s6 = new Student("qianjiu", 16, 50,85, 90);

        // 创建集合添加数据
        TreeSet<Student> tes = new TreeSet<>();
        tes.add(s1);
        tes.add(s2);
        tes.add(s3);
        tes.add(s4);
        tes.add(s5);
        tes.add(s6);
        
        for (Student tes2 : tes) {
            tes2.show();
        }
    }
}
